﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SecurityApi.DataAccess
{
    public class BaseRepository : IDisposable
    {
        protected SecurityApiEntities _context = new SecurityApiEntities();

        public BaseRepository()
        {
            //Added these to test some of the lazy loading feature in EF
            //_context.Configuration.LazyLoadingEnabled = false;
            _context.Configuration.ProxyCreationEnabled = false;
        }

        public BaseRepository(SecurityApiEntities context)
        {
            _context = context;
            //Added these to test some of the lazy loading feature in EF
            //_context.Configuration.LazyLoadingEnabled = false;
            _context.Configuration.ProxyCreationEnabled = false;
        }


        public void Dispose()
        {

            _context.Dispose();
        }

    }
}
